body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
    color: #fff;
    text-align: center;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

#root-othello-center {
    min-height: 100vh;
    min-width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 0 40px 0;
    box-sizing: border-box;
}

h1 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 2.8em;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 4px 16px #000a, 0 1px 0 #fff2;
}

#game-mode-select {
    margin: 18px 0 18px 0;
    font-size: 1.15em;
    background: #232526cc;
    display: block;
    padding: 10px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px #0002;
    margin-left: auto;
    margin-right: auto;
}

#main-container {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 40px auto;
    box-sizing: border-box;
}

#left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
    z-index: 1;
}

#game-info, #stats, #action-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    margin-left: auto;
    margin-right: auto;
}

#game-info, #stats {
    background: #2d2f36e6;
    border-radius: 10px;
    box-shadow: 0 2px 12px #0003;
    padding: 12px 28px;
    margin: 0 0 10px 0;
    font-size: 1.25em;
    font-weight: bold;
    letter-spacing: 1px;
    display: inline-block;
}

#action-bar {
    margin: 12px 0 18px 0;
}

#restart, #undo {
    margin: 0 10px;
    padding: 10px 32px;
    font-size: 1.08em;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #1976d2 60%, #42a5f5 100%);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px #0003;
    font-weight: bold;
}
#restart:hover, #undo:hover {
    background: linear-gradient(90deg, #1565c0 60%, #64b5f6 100%);
    transform: translateY(-2px) scale(1.04);
}

#board {
    display: grid;
    gap: 3px;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    background: #444;
    border: 6px solid #888;
    width: max-content;
    box-shadow: 0 8px 32px #0008;
    border-radius: 18px;
    margin-bottom: 20px;
}

.cell {
    width: 60px;
    height: 60px;
    background: #388e3c;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    box-sizing: border-box;
    border: 1.5px solid #2e7d32;
}
.cell:hover {
    background: #43a047;
}

.piece {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 16px #000a, 0 1px 0 #fff4;
    transition: transform 0.3s cubic-bezier(.4,2,.6,1), background 0.2s;
    transform: scale(1);
    position: relative;
}
.piece.flipping {
    animation: flip 0.4s;
}
@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}
.black {
    background: radial-gradient(circle at 60% 30%, #444 60%, #111 100%);
}
.white {
    background: radial-gradient(circle at 40% 40%, #fff 80%, #bbb 100%);
    border: 2px solid #eee;
}

#history {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 40px;
    align-self: flex-start;
    min-width: 240px;
    max-width: 340px;
    background: #232526e6;
    border-radius: 12px;
    padding: 18px 20px;
    font-size: 1.08em;
    text-align: left;
    color: #eee;
    min-height: 32px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 2px 16px #0004;
    line-height: 1.7;
}
#history::-webkit-scrollbar {
    width: 8px;
    background: #232526;
    border-radius: 8px;
}
#history::-webkit-scrollbar-thumb {
    background: #444a;
    border-radius: 8px;
}

@media (max-width: 1100px) {
    #main-container {
        flex-direction: column;
        align-items: center;
        max-width: 98vw;
    }
    #history {
        position: static;
        margin-left: 0;
        margin-top: 18px;
        min-width: 0;
        max-width: 95vw;
        align-self: center;
    }
    #board {
        grid-template-columns: repeat(8, 9vw);
        grid-template-rows: repeat(8, 9vw);
    }
    .cell {
        width: 9vw;
        height: 9vw;
    }
    .piece {
        width: 7vw;
        height: 7vw;
    }
    #root-othello-center {
        padding: 16px 0 16px 0;
    }
}

@media (max-width: 700px) {
    #board {
        grid-template-columns: repeat(8, 9vw);
        grid-template-rows: repeat(8, 9vw);
    }
    .cell {
        width: 9vw;
        height: 9vw;
    }
    .piece {
        width: 7vw;
        height: 7vw;
    }
} 